package vista.panels;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.JButton;

import cliente.ClienteImp;

public class PanelCrearCotizacion extends JPanel {
	private JTextField txtFecha;
	private JTextField txtValidez;
	private JTextField txtCuil;
	private JTextField txtRazonSocial;
	private JTextField txtDescuento;
	private JTextField txtRecargo;
	private JTextField txtNrosolicitud;

	/**
	 * Create the panel.
	 * @param cliente 
	 */
	public PanelCrearCotizacion(ClienteImp cliente) {
		
		JLabel lblFechaddmmyyyy = new JLabel("Fecha (dd/mm/yyyy)");
		
		JLabel lblValidezEnDias = new JLabel("Validez en dias");
		
		JLabel lblCliente = new JLabel("Cliente");
		
		JSeparator separator = new JSeparator();
		
		JLabel lblCuil = new JLabel("Cuil: ");
		
		JLabel lblRazonSocial = new JLabel("Razon Social: ");
		
		JLabel lblDescuento = new JLabel("Descuento: ");
		
		JLabel lblRecargo = new JLabel("Recargo");
		
		JSeparator separator_1 = new JSeparator();
		
		JLabel lblSolicitudDeCotizacion = new JLabel("Solicitud de Cotizacion");
		
		JLabel lblNroSolicitud = new JLabel("Nro Solicitud");
		
		txtFecha = new JTextField();
		txtFecha.setColumns(10);
		
		txtValidez = new JTextField();
		txtValidez.setColumns(10);
		
		txtCuil = new JTextField();
		txtCuil.setColumns(10);
		
		txtRazonSocial = new JTextField();
		txtRazonSocial.setColumns(10);
		
		txtDescuento = new JTextField();
		txtDescuento.setEnabled(false);
		txtDescuento.setColumns(10);
		
		txtRecargo = new JTextField();
		txtRecargo.setEnabled(false);
		txtRecargo.setColumns(10);
		
		txtNrosolicitud = new JTextField();
		txtNrosolicitud.setColumns(10);
		
		JButton btnBuscarCliente = new JButton("Buscar Cliente");
		
		JButton btnAgregarSolicitudA = new JButton("Agregar Solicitud a Cotizacion");
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblFechaddmmyyyy)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtFecha, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblValidezEnDias)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtValidez, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblCuil)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtCuil, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblRazonSocial)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtRazonSocial, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblDescuento)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtDescuento, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblRecargo)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtRecargo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblNroSolicitud)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(txtNrosolicitud, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(separator, GroupLayout.PREFERRED_SIZE, 172, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblCliente))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnBuscarCliente))
						.addGroup(groupLayout.createSequentialGroup()
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
								.addComponent(separator_1, GroupLayout.PREFERRED_SIZE, 170, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblSolicitudDeCotizacion))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(btnAgregarSolicitudA)))
					.addContainerGap(173, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblFechaddmmyyyy)
						.addComponent(txtFecha, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblValidezEnDias)
							.addGap(2))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(txtValidez, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)))
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(separator, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(lblCliente)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblCuil)
								.addComponent(txtCuil, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblRazonSocial)
								.addComponent(txtRazonSocial, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblDescuento)
								.addComponent(txtDescuento, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblRecargo)
								.addComponent(txtRecargo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addComponent(btnBuscarCliente))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(separator_1, GroupLayout.PREFERRED_SIZE, 4, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(lblSolicitudDeCotizacion)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblNroSolicitud)
								.addComponent(txtNrosolicitud, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addComponent(btnAgregarSolicitudA))
					.addContainerGap(55, Short.MAX_VALUE))
		);
		setLayout(groupLayout);

	}
}
